<template>
  <v-toolbar>
    <v-spacer></v-spacer>
    <v-btn>
      <v-toolbar-title @click="save(1)">发布</v-toolbar-title>
    </v-btn>
    <v-btn>
      <v-toolbar-title @click="save()">存草稿</v-toolbar-title>
    </v-btn>
  </v-toolbar>
  <v-text-field label="标题:"></v-text-field>
  <v-select label="类别" :items="['California', 'Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming']"></v-select>
  <Editor :value="emailForm.msg" @updateValue="getMsg" />

</template>
  <script setup>
    import { login } from "@/api/user";
    import { reactive, toRefs } from 'vue';
    import Editor from '@/components/Editor.vue'
    const emailForm = reactive({
      msg: ''
    })
    const getMsg = (val) => {
      emailForm.msg = val
    }
    const save = async (val) => {
      console.log(emailForm)
       const res = await login(emailForm);
       console.log(res); // 这个res就是mock处理函数返回的数据
    }
// https://blog.csdn.net/weixin_66948502/article/details/143057420
  </script>
